class Notice {
  int retCode;
  String retMsg;
  RetObject retObject;

  Notice({this.retCode, this.retMsg, this.retObject});

  /*Notice.fromJson(Map<String, dynamic> json) {
    retCode = json['retCode'];
    retMsg = json['retMsg'];
    retObject = json['retObject'] != null
        ? new RetObject.fromJson(json['retObject'])
        : null;
  }*/

  factory Notice.fromJson(dynamic json) {
    return Notice(
        retCode: json['retCode'],
        retMsg: json['retMsg'],
        retObject: json['retObject']);
  }


  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['retCode'] = this.retCode;
    data['retMsg'] = this.retMsg;
    if (this.retObject != null) {
      data['retObject'] = this.retObject.toJson();
    }
    return data;
  }
}

class RetObject {
  List<Rows> rows;
  int total;
  int page;
  int pageSize;
  int records;
  int rowBegin;
  int rowEnd;

  RetObject(
      {this.rows,
      this.total,
      this.page,
      this.pageSize,
      this.records,
      this.rowBegin,
      this.rowEnd});

/*
  RetObject.fromJson(Map<String, dynamic> json) {
    if (json['rows'] != null) {
      rows = new List<Rows>();
      json['rows'].forEach((v) {
        rows.add(new Rows.fromJson(v));
      });
    }
    total = json['total'];
    page = json['page'];
    pageSize = json['pageSize'];
    records = json['records'];
    rowBegin = json['rowBegin'];
    rowEnd = json['rowEnd'];
  }*/

  factory RetObject.fromJson(dynamic json) {
    return RetObject(
        rows: json['rows'],
        total: json['total'],
        page: json['page'],
        pageSize: json['pageSize'],
        records: json['records'],
        rowBegin: json['rowBegin'],
        rowEnd: json['rowEnd']);
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.rows != null) {
      data['rows'] = this.rows.map((v) => v.toJson()).toList();
    }
    data['total'] = this.total;
    data['page'] = this.page;
    data['pageSize'] = this.pageSize;
    data['records'] = this.records;
    data['rowBegin'] = this.rowBegin;
    data['rowEnd'] = this.rowEnd;
    return data;
  }
}

class Rows {
  int id;
  String serialNo;
  String title;
  String content;
  int updateTime;

  Rows({this.id, this.serialNo, this.title, this.content, this.updateTime});

/*
  Rows.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    serialNo = json['serialNo'];
    title = json['title'];
    content = json['content'];
    updateTime = json['updateTime'];
  }*/
  //工厂模式-用这种模式可以省略New关键字
  factory Rows.fromJson(dynamic json) {
    return Rows(
        id: json['id'],
        serialNo: json['serialNo'],
        title: json['title'],
        content: json['content'],
        updateTime: json['updateTime']);
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['serialNo'] = this.serialNo;
    data['title'] = this.title;
    data['content'] = this.content;
    data['updateTime'] = this.updateTime;
    return data;
  }
}
